home *** CD-ROM | disk | FTP | other *** search
/ Champak 54 / Vol 54.iso / games / turttleo.swf / scripts / DefineSprite_353 / frame_1 / DoAction.as
Encoding:
Text File  |  2007-10-01  |  584 b   |  36 lines

  1. stop();
  2. var Value;
  3. var OnValueChanged;
  4. if(Value == undefined)
  5. {
  6.    Value = true;
  7. }
  8. mcAllocator._visible = false;
  9. GetValue = function()
  10. {
  11.    return Value;
  12. };
  13. SetValue = function(value)
  14. {
  15.    Value = value;
  16.    gotoAndStop(!Value ? 3 : 2);
  17.    if(OnValueChanged != undefined)
  18.    {
  19.       OnValueChanged();
  20.    }
  21. };
  22. this.onPress = function()
  23. {
  24.    SetValue(!Value);
  25. };
  26. SetValue(Value);
  27. this.onRollOver = function()
  28. {
  29.    Helper.PlaySound("soundMenuToggle");
  30.    mcAllocator._visible = true;
  31. };
  32. this.onRollOut = function()
  33. {
  34.    mcAllocator._visible = false;
  35. };
  36.